|
|
|
|
|
|
|
code starts by copying a thin slice of the new image over the left side of the old image. Each time the program should display some more of the new image, it increases the width of the area it copies. |
|
|
|
 |
|
|
|
|
Private Wiping As Boolean
' Wipe pic_new onto pic_old from left to right. Public Sub WipeLeftToRight( _
ByVal pic_new As PictureBox, _
ByVal pic_old As PictureBox, _
ByVal ms_per_frame As Long, _
ByVal pixels_per_frame As Integer)
Dim next_time As Long
Dim wid As Single
Dim hgt As Single
Dim X As Single
' Prevent more than one wipe at a time. If Wiping Then Exit Sub
Wiping = True
wid = pic_old.ScaleWidth
hgt = pic_old.ScaleHeight
' Start moving the image. X = 0
next_time = GetTickCount()
Do While X <= wid ' Copy the area. BitBlt pic_old.hDC, 0, 0, X, hgt, _
pic_new.hDC, 0, 0, vbSrcCopy
pic_old.Refresh
' Wait for the next frame's time. next_time = next_time + ms_per_frame
WaitTill next_time
X = X + pixels_per_frame
Loop
' Finish up. pic_old.Picture = pic_new.Picture
Wiping = False
End Sub |
|
|
|
|
|
|
|
|
Other wipes are almost as simple as this one. The only difference between the routines is in they way they decide which part of the new image to copy over the old one next. For example, a right-to-left wipe copies parts of the new picture over the right side of the old one. |
|
|
|
|
|